package xyz.zdsoft.course_manage_module.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zdsoft.common.utils.Result;
import xyz.zdsoft.course_manage_module.service.AdminInsertCourseService;
import javax.annotation.Resource;
import java.text.ParseException;
@RestController
@Api(tags = "管理员课程管理")
public class AdminInsertCourseController {
    @Resource
    private AdminInsertCourseService adminInsertCourseService;
    @ApiOperation("管理员新增课程")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectDate",value = "课程日期(yyyy-MM-dd)",required = true),
            @ApiImplicitParam(name = "courseName",value = "课程名称",required = true),
            @ApiImplicitParam(name = "dutyTeacherId",value = "责任老师(id)",required = true,example = "6"),
            @ApiImplicitParam(name = "trainTeachers",value = "实训老师(id),若有多个则用','隔开",required = true,example = "6"),
            @ApiImplicitParam(name = "signInTime",value = "签到时间(hh:mm:ss)",required = true),
            @ApiImplicitParam(name = "signOutTime",value = "签退时间(hh:mm:ss)",required = true),
            @ApiImplicitParam(name = "classRome",value = "上课教室",required = true),
            @ApiImplicitParam(name = "remark",value = "备注")
    })
    @PostMapping("/InsertCourse")
    public Result InsertCourse(String projectDate,String courseName,
                               Long[] trainTeachers,Long dutyTeacherId,
                               String signInTime,String signOutTime,
                               String classRome,String remark) throws ParseException {
        return adminInsertCourseService.judgeInsertCourse(projectDate,courseName,dutyTeacherId,
                                                          trainTeachers,signInTime,signOutTime,classRome,remark);

    }

}
